package org.niux.AutoLoginQQ.ui;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Test {
	public Log log = LogFactory.getLog(this.getClass());
	
	public static String format(long ms) {// 将毫秒数换算成x天x时x分x秒x毫秒
		int ss = 1000;
		int mi = ss * 60;
		int hh = mi * 60;
		int dd = hh * 24;

		long day = ms / dd;
		long hour = (ms - day * dd) / hh;
		long minute = (ms - day * dd - hour * hh) / mi;
		long second = (ms - day * dd - hour * hh - minute * mi) / ss;
		long milliSecond = ms - day * dd - hour * hh - minute * mi - second
				* ss;

		String strDay = day < 10 ? "0" + day : "" + day;
		String strHour = hour < 10 ? "0" + hour : "" + hour;
		String strMinute = minute < 10 ? "0" + minute : "" + minute;
		String strSecond = second < 10 ? "0" + second : "" + second;
		String strMilliSecond = milliSecond < 10 ? "0" + milliSecond : ""
				+ milliSecond;
		strMilliSecond = milliSecond < 100 ? "0" + strMilliSecond : ""
				+ strMilliSecond;
		return strDay + " " + strHour + ":" + strMinute + ":" + strSecond + " "
				+ strMilliSecond;
	}

	public void testNull(){
		log.debug("null");
	}
	public static void main(String[] args) {
		// List<QQNumVO> qq = new ArrayList<QQNumVO>();
		//
		// QQNumVO q = new QQNumVO();
		//
		// q.setIndex(0);
		//
		// qq.add(q);
		//
		// int i = 1;
		// while(true){
		// System.out.println(qq.get(0).getIndex());
		// qq.get(0).setIndex(i);
		// i++;
		// }
		// int i = Integer.parseInt("00:34:38".replace(":", ""));
		// System.out.println(i);

		// 初始化DAO
//		try {
//			System.setProperty("java.library.path",System.getProperty("user.dir") + "/sqlitejdbc.dll");
//			System.setProperty("sqlite.purejava","false");
//			Class.forName("org.sqlite.JDBC");
//			Connection conn = DriverManager.getConnection("jdbc:sqlite:"+System.getProperty("user.dir")+"/db/niuxqq.db;password=lyslmx0723");
//			Statement stat = conn.createStatement();
//			ResultSet rs = stat.executeQuery("select * from `qq`;");
//			
//			System.out.println(rs.getRow());
//			rs.close();
//
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		Test t = new Test();
//		t.testNull();
		
		String s = " a   bv  ";
		System.out.println(s.replace(" ", ""));
	}
}
